JBoss Community Archive (Read Only)

JBoss OSGi

R4v42 TCK Setup

Access Restrictions

There is no public access to the OSGi TCK.

You either need to have an OSGi Alliance member login or a RedHat Kerberos Login.
This article is related to JBOSGI-156

Getting the OSGi TCK

The easiest way to get the OSGi TCK is to do an SVN checkout

    svn co https://svn.devel.redhat.com/repos/jboss-tck/osgitck/r4v42

For this you'll need to be connected to the VPN and use your Kerberos login.

You can get the original from here: https://www.osgi.org/members/svn/build/tags/r4v42-core-cmpn-final

Setup the OSGi TCK

Checkout and build the JBOSGi Framework

git clone git://github.com/jbosgi/jbosgi-framework.git
cd jbosgi-framework
mvn -Pall clean install

Copy and edit the setup properties

cd tcksetup
cp ant.properties.example ant.properties
vi ant.properties

Running the OSGi TCK against the RI (Equinox)

ant setup.ri
ant run-core-tests
ant test-reports

Running the OSGi TCK against the JBoss OSGi Framework

ant setup.vi
ant run-core-tests
ant test-reports

Other target are:

clean                   Clean the TCK setup
run-blueprint-tests     Run the TCK blueprint tests
run-core-tests          Run the TCK core tests
run-jdbc-tests          Run the TCK jdbc tests
run-jmx-tests           Run the TCK jmx tests
run-jndi-tests          Run the TCK jndi tests
run-jpa-tests           Run the TCK jpa tests
run-jta-tests           Run the TCK jta tests
run-packageadmin-tests  Run the TCK Package Admin service tests
run-startlevel-tests    Run the TCK Start Level service tests
run-webapp-tests        Run the TCK webapp tests
setup.ri                Setup the TCK using the RI (Equinox)
setup.vi                Setup the TCK using the Vendor Implemenation
test-reports            Generate the TCK test reports
update-framework        Update the JBoss OSGi Framework

Default target: setup.vi

Installing the Eclipse Bnd plugin

Eclipse uses the aQute Bnd plugin to setup the classpath container and for JUnit integration.

Copy the bnd-356.jar to your Eclipse plugins directory.

Please note, the TCK setup uses a bnd version that supports standard JUnit test reports (0.0.365.SP1). This version however, does not work properly as an Eclipse plugin.

Importing the TCK projects

The layout for the core tests is defined in osgi.ct/layout.bnd.

    build.core.tests = 
    org.osgi.test.cases.framework, 
    org.osgi.test.cases.framework.secure, 
    org.osgi.test.cases.framework.launch, 
    org.osgi.test.cases.framework.launch.secure, 
    org.osgi.test.cases.packageadmin, 
    org.osgi.test.cases.condpermadmin, 
    org.osgi.test.cases.permissionadmin, 
    org.osgi.test.cases.startlevel, 
    org.osgi.test.cases.url

Additional to the core test projects, you need to import various other support projects.

images/author/download/attachments/55378675/OsgiTCKEclipseProjects.jpg

Additional to that you would also want to import the projects that you want to test (i.e. framework)

Running TCK tests as JUnit tests

Right-click on the test project you want to run and select "Run As|OSGi JUnit". The Bnd output should appear in the console window.

images/author/download/attachments/55378675/OsgiTCKRunAsJUnit.jpg

Running an individual TCK test

When you have sucessfully run an entire test section you can right-click on an individual test and run/debug it seperately. Breakpoints should work.

Good Luck

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-11 11:34:58 UTC, last content change 2012-11-07 13:15:25 UTC.